package cn.jiyun;


import org.junit.Test;

import java.math.BigDecimal;

public class demo {

    @Test
    public void test_1(){
/*        Double  a= 1.123D;
        Double  b= 1.123D;
        Float   c= 1.0F-09f;
        Float   d= 0.9f-08f;
        System.out.println(a == b);
        float diff = 1e-6f;
        System.out.println(diff);*/

        BigDecimal a1 = new BigDecimal("1.0");
        BigDecimal b1 = new BigDecimal("0.9");
        BigDecimal c1 = new BigDecimal("0.8");
        BigDecimal x = a1.subtract(b1);
        BigDecimal v = b1.subtract(c1);
            System.out.println(x.compareTo(v)==0);

    }
}
